package net.xiduth.utils;

import java.sql.ResultSet;

import net.xiduth.game.player.Player;

public class DonationHandler extends Thread {

/*	Player c;
	Connections con;
	String auth;

	@Override
	public void run() {
		try {
			this.con.createConnection();
			final ResultSet x = this.con.query("select * from items where code='" + this.auth + "'");
			if (x.next()) {
				final int type = x.getInt("type");
				switch (type) {
				case 3:
					c.setSuperDonator(true);
					c.sendMessage("You are now a super donator!");
					break;
				case 4:
					c.setExtremeDonator(true);
					c.sendMessage("You are now a extreme donator!");
					break;
				case 5:
					c.sendMessage("You are now a vip donator!");
					c.setVIPDonator(true);
					break;
				case 1:
					c.setDonator(true);
					c.sendMessage("You are now a donator!");
					break;
				case 7:
					c.getSquealOfFortune().setSpins(c.getSquealOfFortune().getSpins() + x.getInt("amount"));
					c.sendMessage("You have recieved your spins!");
					break;
				case 2:
					final int item_id = x.getInt("item_id");
					final int amount = x.getInt("amount");
					c.getInventory().addItem(item_id, amount);
					c.sendMessage("You have recieved your item!");
					break;
				}
				this.c.sendMessage("Thanks for donating " + c.getUsername() + "!");
				this.con.query("delete from items where code='" + this.auth + "'");
				this.con.destroyConnection();
				return;
			} else {
				this.c.sendMessage("Please donate before trying to claim an auth!!");
			}
		} catch (final Exception e) {
			e.printStackTrace();
		}
	}

	public DonationHandler(final Player c, final String auth) {
		this.con = new Connections("donate");
		this.c = c;
		this.auth = auth;
	}*/
}
